<template>
  <view class="Contbox">
    <topItem   :labels="labels" :img="imgs" :infor="company" :job="job" />
    <base1 :job="job" :infor="company" />
    <base2 :job="job" />
    <base3 :job="job"  />
    <base4 :job="job"  :infor="company" />
	<footers :job="job" :jobId="jobId" />
  </view>
</template>

<script>
import topItem from "./item/top.vue";
import base1 from "./item/base1.vue";
import base2 from "./item/base2.vue";
import base3 from "./item/base3.vue";
import base4 from "./item/base4.vue";
import footers from "./item/footer.vue"
import api from '../../../../api/routes.js'
	import {
		mapMutations
	} from 'vuex'
export default {
  components: {
    topItem,
    base1,
    base2,
    base3,
    base4,
	footers
  },
  name: "detail",
  data() {
    return {
				jobId:'',
				company:{},
				job:{},
        imgs:[],
        labels:[]
    };
  },
  onLoad(e) {
    console.log(e.jobId);
		this.jobId = e.jobId;
		this.getList();
    	this.setSearchPage(1);
  },
	methods:{
    	...mapMutations(["setSearchPage"]),
		async getList() {
			const res = await this.$myRequest({
        // url: "/app/job/jobDetail",
        url:api.jobDetail,
        method: "GET",
        data: {
          jobId: this.jobId
        },
      });
			console.log(res.data,"814814");
			if(res.data.code==0){
						
						this.job =res.data.job 
						
						if(res.data.company){
								this.company = res.data.company ?res.data.company :{} 
							if(res.data.company.descImgUrls){
								this.imgs = res.data.company.descImgUrls.split(',')
							}
							 
						}else{
							 this.imgs =[]
						}
           
            this.labels = res.data.job.labels.split(',')
			}
		},
	}
};
</script>
<style lang="scss" scoped>
.Contbox {
  padding: 0 0 60px 0;
}
</style>